# ifndef __PtTrim_H_
# define __PtTrim_H_

//
// Trimming.
//

# include "PtAlgo.h"

struct map_t;
struct rgn_t;

// Set the context for creation RG nodes at trimmed edges.
void SetTrimmingCtx (map_t * _pMap, const epoints_t & _epoints, bool _bExternalNodes);
void ResetTrimmingCtx ();

// Trim with semi-plan AB.
void TrimPolyline (const point_t & _A, const point_t & _B, const epoints_t & _epointsIn, bool _bHasRGNodes, polyepoints_t & _epointsOut, rgn_t * _pRgn);
//void TrimPolyline (const point_t & _A, const point_t & _B, const points_t  & _pointsIn,                    polypoints_t  & _pointsOut);
void TrimPolygon  (const point_t & _A, const point_t & _B, const epoints_t & _epointsIn,                    polyepoints_t & _epointsOut);
//void TrimPolygon  (const point_t & _A, const point_t & _B, const points_t  & _pointsIn,                    polypoints_t  & _pointsOut);

// Trim by rectangle mask.
void TrimPolylineOutsideRect (const rect_t & _rectMask, const epoints_t & _epointsIn, bool _bHasRGNodes, polyepoints_t & _epointsOut, rgn_t * _pRgn);
void TrimPolygonOutsideRect  (const rect_t & _rectMask, const epoints_t & _epointsIn,                    polyepoints_t & _epointsOut);

# endif // __PtTrim_H_